package io;

import java.io.*;
import java.util.Scanner;

public class PWDemo2 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos = new FileOutputStream("t8.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw2 = new PrintWriter(bw,true);

        Scanner scan = new Scanner(System.in);
        PrintWriter pw = new PrintWriter("t8.txt");
        while (true) {
            System.out.println("请输入备忘录信息：");
            String str = scan.next();
            if("exit".equals(str)){
                System.out.println("程序退出！");
                break;
            }
        pw.println(str);
        pw.flush();

    }
        pw.close();
    }
}
